package cn.edu.neusoft.yuejian_02.model;

import java.util.List;

import cn.edu.neusoft.yuejian_02.bean.MatchBean;
import cn.edu.neusoft.yuejian_02.listener.RetrofitListener;
import cn.edu.neusoft.yuejian_02.service.MatchService;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

/**
 * Created by jj on 2017/10/9.
 */

public class MatchModel extends BaseModel{

    public void MatchList(final RetrofitListener listener){
        MatchService service=retrofit.create(MatchService.class);
        Call<List<MatchBean>> call = service.matchList();
        call.enqueue(new Callback<List<MatchBean>>() {
            @Override
            public void onResponse(Call<List<MatchBean>> call, Response<List<MatchBean>> response) {
                List<MatchBean> awardBeen =  response.body();
                listener.onSuccess(awardBeen);
            }

            @Override
            public void onFailure(Call<List<MatchBean>> call, Throwable t) {
                listener.onFail();
            }
        });
    }
}
